Histogram equalization apparatus for contrast enhancement of moving image and method therefor

ABSTRACT

A histogram equalization apparatus for contrast enhancement of a moving image includes a CDF calculator for counting the number of pixels having a gray level from the minimum to the maximum or less with respect to an input image in a frame unit to calculate a cumulative distribution function (CDF) value of each gray level, and a look-up table for updating histogram-equalized level corresponding to each gray level of the input moving image in a frame unit based on the CDF value of each gray level, and outputting a corresponding histogram-equalized level according to a level of the input moving image. Therefore, the histogram equalization apparatus can perform real-time histogram equalization on a moving image with a simple hardware, without using a frame memory, a probability density function (PDF) calculator and dividers for a cumulative density function (CDF) calculation.

TECHNICAL FIELD

The present invention relates to a histogram equalization apparatus forcontrast enhancement of a moving image and a method therefor, and moreparticularly, to a histogram equalization apparatus having a simplehardware and a method therefor.

BACKGROUND ART

The histogram of gray levels provides an entire description of theappearance of an image. Gray levels properly controlled with respect toa given image enhances the appearance or contrast of the image.

Histogram equalization is the most widely used and well-known among themethods for contrast enhancement. A method for enhancing the contrast ofa given image according to the sample distribution of the image isdisclosed in the following references: [1] J. S. Lim, “Two-DimensionalSignal and Image processing”, Prentice Hall, Englewood Cliffs, N.J.,1990, [2] R. C. Gonzalez and P. Wints, “Digital Image Processing,”Addison-Wesley, Reading, Mass. 1977.

Generally, since histogram equalization (so-called “distributionequalization”) has an effect for expanding the dynamic range, histogramequalization flattens the gray level distribution of the resultantimage, so that the contrast of the image is enhanced.

Particularly, the histogram equalization in a medical engineering fieldas a method for distinct contrast between pixels of an image which ispicked up indistinctly is very important in the recognition of theimage.

Here, a typical histogram equalization method will be described briefly.

A given image {X} is composed of L discrete gray levels {X₀, X₁, . . . ,X_(L−1)}. Here, X₀=0 represents a black level, and X_(L−1)=1 representsa white level.

A probability density function (PDF) is defined by the following formula(1). $\begin{matrix}{{{p\left( X_{k} \right)} = \frac{n_{k}}{n}},{{{for}\quad k} = 0},1,\ldots \quad,{L - 1}} & (1)\end{matrix}$

Here, n_(k) represents the frequency of the grays level (X_(k)) in theimage {x}, and n represents the number of total samples (pixels) in theimage {X}. Also, a cumulative distribution function (CDF) is defined bythe following formula (2). $\begin{matrix}{{c\left( X_{k} \right)} = {\sum\limits_{j = 0}^{k}{p\left( X_{j} \right)}}} & (2)\end{matrix}$

An output (Y) of the typical histogram equalization with respect to aninput sample (X_(k)) of the given image is obtained by the followingformula (3) based on the CDF.

Y=c(X _(k))X _(L−1)  (3)

The histogram equalization method will be described in detail withreference to FIGS. 1 through 3.

FIG. 1 shows an example of a PDF of a specific image. That is, aluminance signal with a brightness of 0˜255 gray levels is input, thenumber of pixels at each gray level is then counted, and the result isdivided by the total number of pixels to obtain the result shown in FIG.1.

FIG. 2 shows a curve of the CDF obtained, based on the PDF of FIG. 1.For example, when the value of the CDF corresponding to the gray level“100” at the point P is 0.875, which indicates that the number of pixelscorresponding to 100 or less gray levels is 87.5% with respect to theinput image.

FIG. 3 shows the PDF of the image passed through histogram equalizationbased on the CDF shown in FIG. 2. That is, the level of the outputsignal (Y) after histogram-equalizing an input pixel Y_(IN) is mappedinto a level by the following formula (4).

Y=CDF value corresponding to Y_(IN)×the maximum gray level(X_(L−1))  (4)

For example, the output gray level after the input pixel having the graylevel “100” has been histogram-equalized is mapped into 224 (=0.875×255)levels.

If the input image signal is an analog signal, the new PDF has astraight line (uniform distribution curve) having about 0.004 (=1/256)levels over the whole interval, like Q of FIG. 3. However, if the inputimage signal is a digital signal, the histogram equalization isperformed to a quantized level, and the result of FIG. 3 is obtained.That is, assuming that the output gray level based on the CDF value(0.37) of FIG. 2 is mapped into about “95” when the input gray level is“51”, and the output gray level based on the CDF value (0.47) of FIG. 2is mapped into about “120” when the input gray level is “52”, the outputgray level of the input image signal having a gray level between “51”and “52” should be mapped into between about 95 and 120. However, a graylevel between “51” and “52” does not exist when quantization isperformed, so that a uniform distribution curve cannot be obtained.

Thus, as can be seen from FIGS. 1 and 3, the luminance level of theinput image concentrated between the gray levels “50” and “100” ismapped into an extended luminance level having the gray levels between10 and 200, so that the contrast is enhanced.

However, the above-described histogram equalization method has beenapplied to a still image to improve the image recognition capability andthe contrast of the still image due to its problems related to theprocessing time required for obtaining the values of PDF and CDF and thehardware thereof, which causes a problem in that a frame memory forstoring a frame image and a hardware-rich dividing circuit for real-timeprocessing are required when being applied to a moving image.

DISCLOSURE OF THE INVENTION

To solve the above problems, it is an object of the present invention toprovide a histogram equalization apparatus for contrast enhancement of amoving image using a simple hardware.

It is another object of the present invention to provide a method forenhancing contrast by performing a real-time histogram equalization on amoving image such as a TV or VCR video signal.

To achieve the first object, there is provided a histogram equalizationapparatus for contrast enhancement of a moving image expressed by apredetermined number of gray levels. In the histogram equalizationapparatus, a calculator counts the number of pixels having a gray levelfrom the minimum to the maximum or less with respect to an input imagein units of a frame to calculate a cumulative distribution function(CDF) value of each gray level, and a memory updates histogram-equalizedlevels corresponding to each gray level of the input moving image inunits of a frame based on the CDF value of each gray level, and outputsa corresponding histogram-equalized level according to a level of theinput moving image.

To achieve the second object, there is provided a histogram equalizationmethod for contrast enhancement of a moving image expressed by apredetermined number of gray levels, comprising the steps of: (a)counting the number of pixels having a gray level from the minimum tothe maximum or less with respect to an input moving image in units of aframe to output a CDF value of each gray level; and (b) multiplying theCDF value corresponding to the gray level of the input moving image bythe maximum gray level to output a histogram-equalized level.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram showing an example of a probability density function(PDF) of a specific image;

FIG. 2 is a diagram showing a curve of a cumulative distributionfunction (CDF) based on the PDF of FIG. 1;

FIG. 3 is a diagram showing the PDF of an image which ishistogram-equalized based on the CDF of FIG. 2;

FIG. 4 is a circuit diagram of a conventional histogram equalizationapparatus for contrast enhancement of a moving image;

FIG. 5 is a detailed circuit diagram of the PDF calculator and the CDFcalculator of FIG. 4;

FIG. 6A is a diagram showing one frame of an NTSC image, and FIG. 6B isa timing diagram of the circuit shown in FIG. 4;

FIG. 7 is a block diagram of a histogram equalization apparatus forcontrast enhancement of a moving image according to a preferredembodiment of the present invention;

FIG. 8 is a detailed circuit diagram of the CDF calculator of FIG. 7;

FIG. 9 is a detailed circuit diagram of the accumulator of FIG. 8; and

FIG. 10 is a diagram illustrating a CDF calculation area in one frame ofthe NTSC image, which is used in the present invention.

BEST MODE FOR CARRYING OUT THE INVENTION

Prior to describing an embodiment of the present invention, aconventional histogram equalization apparatus for contrast enhancementof a moving image will be described with reference to FIGS. 4 through6B.

The conventional histogram equalization apparatus of FIG. 4 includes aprobability density function (PDF) calculator 110, a cumulative densityfunction (CDF) calculator 120, a look-up table 130 and a frame memory140.

In FIG. 4, the PDF calculator 110 calculates the PDF by counting thenumber of input pixels having a gray level between 0 and 255 during oneframe of an active picture area (720 pixels×480 lines in the case of theNTSC) when an 8-bit signal passed through the A/D conversion is input.

The CDF calculator 120 calculates the CDF based on the calculated PDF,and includes a plurality of adders and a plurality of dividers.

FIG. 5 is a detailed diagram of the PDF calculator 110 and the CDFcalculator 120 of FIG. 4.

In FIG. 5, each comparator 112.1˜112.256 of the PDF calculator 110compares an input pixel with each gray level from a minimum “0” to amaximum “255”.

For example, the comparator 112. 1 compares the input pixel with thegray level “0” and outputs a “high (1)” signal if the input pixel isequal to the gray level to accumulate the output in an accumulator114.1. The comparator 112.2 compares the input pixel with the gray level“1” and outputs a “high (1)” signal if the input pixel is equal to thegray level “1” to accumulate the output in an accumulator 114.2. Theabove comparison and accumulation are repeated by each comparator andaccumulator. Finally, a comparator 112.256 compares the input pixel withthe gray level “255” and outputs a “high (1)” signal if the input pixelis equal to the gray level “255” to accumulate the output in anaccumulator 114.256.

Thus, the counted number of input pixels of each gray level from “0” to“255” during the active picture area of an input frame image, that is, aprobability of existence of pixel in each gray level of one frame image,is accumulated in each accumulator 114.1˜114.256, so that the output ofeach accumulator 114.1˜114.256 becomes PDF multiplied by the number oftotal pixels.

On the other hand, each adder 122.1˜122.255 of the CDF calculator 120outputs a value corresponding to the number of pixels per frame having agray level of “1” or less through the number of pixels having a graylevel of “255” or less, respectively.

For example, the adder 122.1 sums the output of the accumulator 114.1and the output of the accumulator 114.2 to output the sum of theproducts (PDF×the number of total pixels) for gray levels between “0”and “1.” Also, the adder 122.254 sums the output of the accumulator114.255 and the output of the adder 122.253, which corresponds to thesum of the products (PDF×the number of total pixels) for the gray levelsbetween “0” and “254.” The adder 122.255 sums the output of theaccumulator 114.256 and the output of the adder 122.254, whichcorresponds to the sum of the products (PDF×the number of total pixels)for the gray levels “0” between “255.” The CDF values from the graylevel “0” to “255” are output from each divider 124.1˜124.256.

For example, the divider 124.1 divides the number of pixels having thegray level “0” output from the accumulator 114.1 by the number of totalpixels n, and the divider 124.2 divides the number of pixels having agray level of “1” or less per frame output from the adder 122.1 by thenumber of total pixels n, and the divider 124.256 divides the number ofpixels having a gray level of “255” or less per frame output from theadder 124.255 by the number of total pixels n.

As a result, the values obtained by multiplying new CDFs obtained forone frame output from each divider 124.1˜124.255, that is, CDFscorresponding to input levels by the maximum gray level “255,” arestored in the look-up table 130 of FIG. 4.

FIG. 6A shows a standard image format in the NTSC mode of the NTSC CCIR601 having a size of 858 pixels×525 lines. In this frame image format,the active picture area used in the PDF calculator 110 and the CDFcalculator 120 has a size of 720 pixels×480 lines, and the number oftotal pixels n thereof is equal to 720×480.

On the other hand, a period for updating the CDF value of a new framecalculated by the CDF calculator 120 according to a frame synchronoussignal (FRAME SYNC) in the look-up table 130 shown in FIG. 4 correspondsto “d” of FIG. 6B. Here, the period “d” is a vertical blanking period ofa real image signal, which is not displayed on the screen. Thus, eventhough the value stored in the look-up table 130 is updated with the CDFvalue of the new frame for the period “d”, the frame is not affected.The periods “a” and “b” of FIG. 6B are sampling periods for the PDF andCDF calculations, and simultaneously histogram equalization periods, andthe period “c” is a period without operation. Here, the framesynchronous signal FRAME SYNC input to the look-up table 130 is acontrol signal representing the vertical blacking period “d” of thefirst field.

A value obtained by multiplying the CDF value corresponding to the graylevel of the input pixel output from the frame memory 140 by the maximumgray level is output from the look-up table 130 storing the valueobtained by multiplying the updated CDF value by the maximum gray level.

Here, in order to perform histogram equalization on the frame datastatistically processed by the PDF calculator 110 and the CDF calculator120, an input image signal is delayed by one frame by the frame memory140.

However, the correlation between the previous frame and the currentframe is above 0.95 in consideration of the characteristics of themoving image, so that the histogram equalization can be performedwithout problems even though the CDF obtained in the previous frame isapplied intact to the current frame without using the hardware-richframe memory.

When the frame changes suddenly, histogram equalization is notperformed. However, it can be seen from experimentation that the imagedistortion of about one frame (1/30 sec) is not detected due to theafterimage effect of the human eye.

Therefore, a histogram equalization apparatus having a simple hardwareis proposed by the present invention, in which the CDF is directlycalculated from the input pixel without calculating the PDF, so that aframe memory, an PDF calculator, and dividers of the CDF calculatorwhich require much hardware can be omitted.

FIG. 7 is a circuit diagram of a histogram equalization apparatus forcontrast enhancement of a moving image according to a preferredembodiment of the present invention.

The histogram equalization apparatus of the present invention includes aCDF calculator 210 and a look-up table 220.

In FIG. 7, the CDF calculator 210 directly calculates the CDF value fromthe input image signal with respect to each gray level=0, gray level≦1,. . . , gray level≦128, . . . , and gray level≦255.

A detailed circuit diagram of the CDF calculator 210 is shown in FIG. 8.

In FIG. 8, each comparator 212.1˜212.256 compares an input pixel with arespective gray level from “0” to “255”. That is, the comparator 212.256outputs a signal “1” when a pixel having a gray level of “255” or lessis input, the comparator 212.255 outputs a signal “1” when a pixelhaving a gray level of “254” or less is input, and the comparator 212.1outputs a signal “1” when a pixel having the gray level “0” is input.

Each accumulator 214.1˜212.256 increases by one if the output of eachcomparator 212.1˜212.256 input to each enable port ENA is equal to “1”whenever a clock signal (CLK) is input, and outputs the currentlyaccumulated value when a frame synchronous signal (FRAME SYNC) is inputto each hold & clear port to clear the accumulated value to “0.”

The clock signal (CLK) input to each accumulator 214.1˜241.256 isobtained by AND-operating a system clock signal (SYS CLK) and an areacontrol signal (AREA) representing an CDF calculation area in an ANDgate 216.

For example, a signal output from the accumulator 214.256 represents thenumber of pixels having a gray level of “255” or less per frame, asignal output from the accumulator 214.255 represents the number ofpixels having a gray level of “254” or less per frame, and a signaloutput from the accumulator 214.1 represents the number of pixels havingthe gray level “0” per frame.

The detailed structure of each accumulator 214.1˜214.256 is shown inFIG. 9. Here, the structure of the accumulator 214.256 will be describedas an example.

As shown in FIG. 9, an adder 241 sums the output “1” of the comparator212.256, which is input as an enable signal ENA, and a feedback signal,and the summed signal is latched to a first latch 244 via an AND gate242. The AND gate 242 is cleared by the frame synchronous signal (FRAMESYNC) input via an inverter 243.

A signal obtained by OR-operating the frame synchronous signal (FRAMESYNC) and the clock signal (CLK) in an OR gate 245 is input to a clockport of the first latch 244, and the first latch 244 feeds back thelatched output as a feedback signal to the adder 241 and simultaneouslyoutputs the latched output to the second latch 246 whenever the outputof the OR gate 245 is equal to “1”.

The second latch 246 receives the frame synchronous signal (FRAME SYNC)as a hold signal at a clock port thereof and outputs a value obtained byholding the output of the first latch 245, that is, the number of pixelshaving a gray level of “255” or less per frame during the CDFcalculation area, according to the frame synchronous signal FRAME SYNC.

Here, in the CDF calculation area used in the present invention, only640 pixels×204.8 lines per field among 720 pixels×480 lines effectivepixels in the NTSC standard image (858 pixels×525 lines) of the NTSCCCIR 601 of FIG. 10 are used as a CDF calculation area for the histogramequalization.

Also, if the CDF is calculated using only 2¹⁸ (640×204.8×2) pixels perframe, that is, by setting the number of total pixels n to 2^(m) (wherem is an integer), the dividers 124.1˜124.256 of the CDF calculator 120shown in FIG. 5 are not required. Here, since it is difficult to designthe logic of the divider, the designing of a circuit is simplified ifthe divider is omitted.

In FIG. 5, the whole image of 720 pixels×480 lines is used as the CDFcalculation area, so that the number of total pixels n is equal to720×480. That is, the number of total pixels cannot be expressed by2^(m), so that dividers having the complicated design are necessary.

However, in order to calculate the CDF values of each gray level usingthe CDF calculator 210 of the present invention, all outputs of theaccumulators 214.1˜214.256, that is, from the number of pixels having agray level of “0” per frame to the number of pixels having a gray levelof “255” or less per frame, should be divided by the number of totalpixels, respectively. However, the real meaning of the division by thenumber of total pixel n of 2^(m) is only to shift, so that a divider isnot required.

Thus, values shifted by the number (here, 18) corresponding to the powerof radix-2 with respect to all outputs from the CDF calculator 210, thatis, from the number of pixels having a gray level of “0” to the numberof pixels having a gray level of “255” or less per frame, are multipliedby the maximum gray level, respectively, and then the results are storedin the look-up table 220 of FIG. 7.

Here, a period for which the CDF value of new frame of the look-up table220 is updated according to the frame synchronous signal (FRAME SYNC)corresponds to the vertical blacking period “d” of the first field asdescribed with reference to FIG. 6B. Thus, the equalization outputcorresponding to the input pixel can be obtained by selecting a valuestored in the look-up table 220 corresponding to the input pixel.

The present invention can be applied to a circuit having a structurewhich is simpler than that of the CDF calculator 210 of FIG. 7.According to the circuit having the simple structure, CDFs of thequantized gray level are calculated instead of the CDFs of each graylevel from the minimum to the maximum, and then the obtained CDFs of thequantized gray level are interpolated to output the result.

INDUSTRIAL APPLICABILITY

As described above, in the histogram equalization apparatus of thepresent invention, a frame memory, an PDF calculator and dividers forthe CDF calculation are omitted such that the histogram equalizationfunction which could be applied to only a still image using the programoperation can be applied to a moving image in a real-time processingwith the simple structure.

What is claimed is:
 1. A histogram equalization apparatus for a imageexpressed by a predetermined number of gray levels, comprising: acalculator for counting the number of pixels having a gray level fromthe minimum to the maximum or less with respect to an input image in ascreen unit to calculate cumulative distribution function (CDF) valuesof each gray level; and a memory for updating histogram-equalized levelscorresponding to each gray level of the input image in a screen unitbased on the CDF value of each gray level of a previous screen unit, andoutputting a corresponding histogram-equalized level according to alevel of the input image; wherein the calculator comprises: a pluralityof comparators for comparing whether the level of the input image isless than or equal to each gray level; and a plurality of accumulatorsfor accumulating each output of the plurality of comparators to outputthe CDF values of each gray level from the minimum to the maximum orless per one screen unit.
 2. The histogram equalization apparatus ofclaim 1, wherein the screen unit is a frame.
 3. The histogramequalization apparatus of claim 1, wherein each accumulator accumulatesthe output of each comparator whenever a clock signal is input, andoutputs an accumulated value and simultaneously clears the accumulatedvalue according to a frame synchronous signal.
 4. A histogramequalization apparatus for a image expressed by a predetermined numberof gray levels, comprising: a calculator for counting the number ofpixels having a gray level from the minimum to the maximum or less withrespect to an input image in a screen unit to calculate cumulativedistribution function (CDF) values of each gray level; and a memory forupdating histogram-equalized levels corresponding to each gray level ofthe input image in a screen unit based on the CDF value of each graylevel, and outputting a corresponding histogram-equalized levelaccording to a level of the input image; wherein the calculatorcomprises: a plurality of comparators for comparing the level of theinput image with each gray level; and a plurality of accumulators foraccumulating each output of the plurality of comparators to output theCDF values of each gray level from the minimum to the maximum or lessper one screen unit, wherein each accumulator accumulates the output ofeach comparator whenever a clock signal is input, and outputs anaccumulated value and simultaneously clears the accumulated valueaccording to a frame synchronous signal, and wherein the clock signal isgenerated according to a system clock signal and an area control signalrepresenting a CDF calculation area.
 5. The histogram equalizationapparatus of claim 4, wherein the number of total pixels of a CDFcalculation area is equal to 2^(m), where m is an integer.
 6. Thehistogram equalization apparatus of claim 1, wherein thehistogram-equalized levels stored in the memory are obtained bymultiplying the CDF values of each gray level calculated by thecalculator by the maximum gray level.
 7. The histogram equalizationapparatus of claim 5 wherein the histogram-equalized levels stored inthe memory are obtained by shifting the values of each gray level fromthe minimum to the maximum or less by the number (m) corresponding tothe power of radix-2, and then multiplying each shifted result by themaximum gray level.
 8. A histogram equalization method for a imageexpressed by a predetermined number of gray levels, comprising the stepsof: (a) counting the number of pixels having a gray level from theminimum to the maximum or less with respect to an input moving image ina screen unit to output a CDF value of each gray level; and (b)multiplying the CDF value corresponding to the level of a previous unitof the input moving image by the maximum gray level to output ahistogram-equalized level; wherein the step (a) comprises the sub-stepsof: (a1) comparing whether the level of the input image is less than orequal to each gray level from the minimum to the maximum or less; and(a2) accumulating compared results of the step (a1) in a screen unit tooutput all values from the number of pixels having a gray level from theminimum to the maximum or less per screen.
 9. The histogram equalizationmethod of claim 8 wherein the number of total pixels of a CDFcalculation area is equal to 2^(m), where m is an integer.
 10. Thehistogram equalization method of claim 8 wherein the screen unit is aframe.
 11. A histogram equalization method for a image expressed by apredetermined number of gray levels, comprising the steps of: (a)counting the number of pixels having a gray level from the minimum tothe maximum or less with respect to an input image in a screen unit tooutput a CDF value of each gray level; and (b) multiplying the CDF valuecorresponding to the level of the input image by the maximum gray levelto output a histogram-equalized level, wherein the number of totalpixels of a CDF calculation area is equal to 2^(m), where m is aninteger, and wherein the histogram-equalized levels of the step (b) isobtained by shifting the values of each gray level from the minimum tothe maximum or less by the number (m) corresponding to the power ofradix-2, and then multiplying each shifted result by the maximum graylevel.